﻿<extend name="Public:base" />
<block name="title"><title>个人资料</title></block>
<block name="header_styles">

</block>
<block name="main">
    <div class="row">
        <div class="col-xs-3">
            <div class="column-sidebar">
                <include file="Public:LeftMenu" />
            </div>
        </div>
        <div class="col-xs-9">
            <div class="column-main">
                <div class="section">
                    <div class="section-title">
                        信誉评价
                    </div>
                    <div class="section-content">
                        <div class="profile-section">
                            <div class="profile-section-title">
                                <ul role="tablist">
                                    <if condition="$userinfo['utype'] eq 1"><li role="presentation" class="active"><a href="#tab1" aria-controls="tab1" class="tab-link" role="tab" data-toggle="tab">雇主评价</a></li></if>
                                    <li role="presentation" <if condition="$userinfo['utype'] eq 2">class='active'</if> ><a href="#tab2" class="tab-link" aria-controls="tab2" role="tab" data-toggle="tab">人才评价</a></li>
                                </ul>
                            </div>
                            <div class="tab-feedback-content">
                                <if condition="$userinfo['utype'] eq 1">
                                <div role="tabpanel" id="tab1" class="tab-feedback-panel active">
                                    <div class="profile-section-content">
                                        <ul>
                                            <li>
                                                <strong>好 评 率：</strong>&nbsp;<span class="text-green">{$wellrateL}%</span>
                                            </li>
                                            <li class="star-line">
                                                <strong>工作态度：</strong>&nbsp;
                                                <div class="star-panel" data-score="{$ratearrL['avg1']|score2rate}"></div>
                                                &nbsp;<span>{$ratearrL['avg1']|score2rate}</span>
                                            </li>
                                            <li class="star-line">
                                                <strong>专业能力：</strong>&nbsp;
                                                <div class="star-panel" data-score="{$ratearrL['avg2']|score2rate}"></div>
                                                &nbsp;<span>{$ratearrL['avg2']|score2rate}</span>
                                            </li>
                                            <li class="star-line">
                                                <strong>工作效率：</strong>&nbsp;
                                                <div class="star-panel" data-score="{$ratearrL['avg3']|score2rate}"></div>
                                                &nbsp;<span>{$ratearrL['avg3']|score2rate}</span>
                                            </li>
                                            <li class="star-line">
                                                <strong>沟通能力：</strong>&nbsp;
                                                <div class="star-panel" data-score="{$ratearrL['avg4']|score2rate}"></div>
                                                &nbsp;<span>{$ratearrL['avg4']|score2rate}</span>
                                            </li>
                                        </ul>
                                    </div>

                                    <div class="profile-feedbacks">
                                        <volist name='commentsL' id='commentL'>
                                        <div class="profile-feedback-item">
                                            <span class="feedback-status">{$commentL['rate']|rate2C}</span>
                                            <div class="profile-feedback-heading">
                                                <span class="pull-right">
                                                    {$commentL['startdate']|toTime=###,'Y.m.d'}-{$commentL['endate']|toTime=###,'Y.m.d'}
                                                </span>
                                                <span>
                                                    雇主：{$commentL['author']}&nbsp;&nbsp;&nbsp;&nbsp;职位：{$commentL['jobname']}
                                                </span>
                                            </div>
                                            <div class="profile-feedback-content">{$commentL['content']}</div>
                                        </div>
                                        </volist>
                                    </div>
                                </div>
                                </if>
                                <div role="tabpanel" id="tab2" class="tab-feedback-panel  <if condition="$userinfo['utype'] eq 2">active</if>">
                                    <div class="profile-section-content">
                                        <ul>
                                            <li>
                                                <strong>好 评 率：</strong>&nbsp;<span class="text-green">{$wellrateR}%</span>
                                            </li>
                                            <li class="star-line">
                                                <strong>企业待遇：</strong>&nbsp;
                                                <div class="star-panel" data-score="{$ratearrR['avg1']|score2rate}"></div>
                                                &nbsp;<span>{$ratearrR['avg1']|score2rate}</span>
                                            </li>
                                            <li class="star-line">
                                                <strong>领导能力：</strong>&nbsp;
                                                <div class="star-panel" data-score="{$ratearrR['avg2']|score2rate}"></div>
                                                &nbsp;<span>{$ratearrR['avg2']|score2rate}</span>
                                            </li>
                                            <li class="star-line">
                                                <strong>沟通能力：</strong>&nbsp;
                                                <div class="star-panel" data-score="{$ratearrR['avg3']|score2rate}"></div>
                                                &nbsp;<span>{$ratearrR['avg3']|score2rate}</span>
                                            </li>
                                            <li class="star-line">
                                                <strong>验收速度：</strong>&nbsp;
                                                <div class="star-panel" data-score="{$ratearrR['avg4']|score2rate}"></div>
                                                &nbsp;<span>{$ratearrR['avg4']|score2rate}</span>
                                            </li>
                                        </ul>
                                    </div>

                                    <div class="profile-feedbacks">
                                        <volist name='commentsR' id='commentR'>
                                        <div class="profile-feedback-item">
                                            <span class="feedback-status">{$commentR['rate']|rate2C}</span>
                                            <div class="profile-feedback-heading">
                                                <span class="pull-right">
                                                    {$commentR['startdate']|toTime=###,'Y.m.d'}-{$commentR['endate']|toTime=###,'Y.m.d'}
                                                </span>
                                                <span>
                                                    人才：{$commentR['author']}    职位：{$commentR['jobname']}
                                                </span>
                                            </div>
                                            <div class="profile-feedback-content">{$commentR['content']}</div>
                                        </div>
                                        </volist>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="footer_scripts">
    <script type="text/javascript">
        requirejs(["jquery"], function () {
            $(function () {

                $(".star-panel").each(function () {
                    var total = 5;
                    var container = $(this);
                    var score = container.data("score");

                    var s1 = Math.floor(score);
                    var s2 = Math.ceil(score);
                    console.log(s1);
                    for (var i = 0; i < s1; i++) {
                        container.append("<span class='fa fa-star'></span>");
                    }
                    if (score - s1 > 0) {
                        container.append("<span class='fa fa-star-half-o'></span>");
                    }

                    for (var i = 0; i < total - s2; i++) {
                        container.append("<span class='fa fa-star-o'></span>");
                    }
                });
            });

        });
    </script>

</block>